package com.kgc.kmall.managerweb.controller;


import com.kgc.kmall.bean.bean.PmsBaseSaleAttr;
import com.kgc.kmall.bean.bean.PmsProductInfo;
import com.kgc.kmall.service.SpuService;
import jdk.nashorn.internal.ir.annotations.Reference;

import java.util.List;

@CrossOrigin
@RestController
public class SpuController {
@Reference
SpuService spuService;
@RequestMapping("/spuList")
    public List<PmsProductInfo> spuList(Long catalog3Id){
    List<PmsProductInfo> infoList=spuService.spuList(catalog3Id);
    return infoList;
}
    @RequestMapping("/fileUpload")
    public String fileUpload(@RequestParam("file") MultipartFile file){
        //文件上传
        //返回文件上传后的路径
        return "https://m.360buyimg.com/babel/jfs/t5137/20/1794970752/352145/d56e4e94/591417dcN4fe5ef33.jpg";
    }
    @RequestMapping("/baseSaleAttrList")
    public List<PmsBaseSaleAttr> baseSaleAttrList(){
        List<PmsBaseSaleAttr> saleAttrList = spuService.baseSaleAttrList();
        return saleAttrList;
    }
    @RequestMapping("/saveSpuInfo")
    public String saveSpuInfo(@RequestBody  PmsProductInfo pmsProductInfo){




        return "success";


}


}
